<template>
    <div class="cardContainer">
        <div class="showImgContainer">
            <img src="../../assets/images/background.jpg" alt="朋友圈封面" class="showImg" />
        </div>
        <div class="cardTitleContainer">
            <div class="cardTitle">
                事件循环每个阶段的具体步骤，比如一次循环处理一个宏任务，然后处理所有微任务，接着可能进行UI渲染。
            </div>
            <div class="infoContainer">
                <div class="userInfo">
                    <img src="../../assets/images/background.jpg" class="avatar" />
                    <span class="realname">jj同学</span>
                </div>
                <div class="likeContainer">
                    <div>赞</div>
                    <span>1万+</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss">
.cardContainer {
    width: 300px;
    height: auto;
    border-radius: 18px;
    border: 1px solid rgb(214, 214, 214);
    background: white;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    cursor: pointer;

    &:hover {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);

        .showImg {
            transform: scale(1.05);
        }
    }

    .showImgContainer {
        width: 100%;
        height: auto;

        .showImg {
            width: 100%;
            height: auto;
            border-radius: 18px 18px 0 0;
            transition: transform 0.3s ease;
        }
    }

    .cardTitleContainer {
        width: 100%;
        height: 100px;
        padding: 10px;
        @include flex-layout(flex, normal, space-between, nowrap, column);

        .cardTitle {
            @include ellipsis-multiple(-webkit-box, 2);
        }

        .infoContainer {
            width: 100%;
            height: 40px;
            @include flex-layout();

            .userInfo {
                flex: 1;
                height: 100%;
                @include flex-layout(flex, center);

                .avatar {
                    width: 2rem;
                    height: 2rem;
                    border-radius: 50%;
                }

                .realname {
                    flex: 1;
                    height: 100%;
                    line-height: 40px;
                    padding: 0 10px;
                    @include ellipsis-multiple();
                }
            }

            .likeContainer {
                width: 60px;
                height: 100%;
                @include flex-layout(flex, center);
            }
        }
    }
}
</style>
